#pragma once

#include <QDialog>

class QCustomDialog :public QDialog
{
	Q_OBJECT;

public:
	QCustomDialog(QWidget* parent = nullptr);
	virtual ~QCustomDialog() = default;

	/**
	 * \brief
	 *
	 * \return 所有标题栏.
	 */
	QList<QWidget*> titleBars();

	/**
	 * \brief 添加一个标题栏.
	 *
	 * \param titleBar 作为标题栏的QWidget.
	 */
	void addTitleBar(QWidget* titleBar);

	/**
	 * \brief 删除一个标题栏.
	 *
	 * \param titleBar 要删除的标题栏.
	 */
	void removeTitleBar(QWidget* titleBar);

	/**
	 * \brief 设置圆角风格.
	 *
	 * \param roundStyle 是否为圆角风格.
	 */
	void setRoundStyle(bool roundStyle);

	/**
	 * \brief 设置触发改变大小的边框粗细.
	 *
	 * \param borderThinness 边框粗细.
	 */
	void setBorderThinness(qint32 borderThinness);

protected:
	virtual bool nativeEvent(const QByteArray& eventType, void* message, long* result) override;

private:
	QList<QWidget*> m_titleBars;
	qint32 m_borderThinness;
	bool m_canRank;
	bool m_roundStyle;

};

